import request from "../utils/request";

// 获取轮播的消息（六条）
export const getLatestNewsAPI = () => request({
  url: '/api/news/latest'
})

// 获取回答详情
export const getAnswerDetailAPI =(id)=>request({
  url: `/api/news/${id}`
})

// 获取热门回答列表
export const getHotAnswerAPI = ()=>request({
  url: '/api/news/hot'
})

// 获取以往的回答
export const getBeforeAnswerAPI= (time)=>request({
  url: `/api/news/before/${time}`
})

// 获取回答的额外信息（点赞、评论数）
export const getExtraInfoAPI = (id)=>request({
  url: `/api/story-extra/${id}`
})

// 获取长评论
export const getLongCommentAPI = (id)=>request({
  url: `/api/story/${id}/long-comments`
})

// 获取短评论
export const getShortCommentAPI = (id)=>request({
  url: `/api/story/${id}/short-comments`
})

// 获取所有的合集
export const getAllSectionAPI = ()=>request({
  url: '/api/sections'
})

// 获取某个合集的详情列表
export const getSectionList = (id)=>request({
  url: `/api/section/${id}`
})

// 获取往前的合集
export const getSectionBefore = (id,timestamp)=>request({
  url: `/api/section/${id}/before/${timestamp}`
})